How to solve these challenges:
To be consistent with the filenames and paths run the commands on Ubuntu. Install it locally in a VM or at a cloud provider. Use my referral link below to create your account on DigitalOcean and youll get $100 in credit over 60 days: https://m.do.co/c/f1d4debf213f
Write your solution in a terminal and test it.
If your solution is not correct, then try to understand the error messages, watch the video again, rewrite the solution and test it again. Repeat this step until you get the correct solution.
Save the solution in a file for future reference or recap.
Challenge #1
Consider the following variable: friends="Anne John Jenna Arena Paul Dan"
Create a script that uses a simple for loop and says Hello to each friend in the list.
Are you stuck? Do you want to see the solution for this challenge? Click here.
Challenge #2
Create a script that prompts the user for a file. Test that its a file.
Prompt the user for 2 positive integers n and m.
Display the lines (from line number n to m, both inclusive) of the text file.
Are you stuck? Do you want to see the solution for this challenge? Click here.
Challenge #3
Create a script that displays odd numbers between 1 and 50.
Are you stuck? Do you want to see the solution for this challenge? Click here.
Challenge #4
Develop a script that will create 5 text files in the current directory.
Are you stuck? Do you want to see the solution for this challenge? Click here.
Challenge #5
Develop a script that prompts the user for a number n and then creates n text files in the current directory.
Are you stuck? Do you want to see the solution for this challenge? Click here.
Challenge #6
Consider the solution from the previous challenge. Add a testing condition so that the user enters a positive integer less than 100.
Are you stuck? Do you want to see the solution for this challenge? Click here.
Challenge #7
Consider the solution from the previous challenge.
Change the script so that it creates a file every 3 seconds and the name of each file will be current_minute_second
Are you stuck? Do you want to see the solution for this challenge? Click here.
Challenge #8
Create a script that takes some IP addresses as arguments and sends one ping packet to each ip address.
Are you stuck? Do you want to see the solution for this challenge? Click here and here.
Challenge #9
Change the solution from the previous challenge so that the script reads the IP addresses from a text file that is given by the user.
Are you stuck? Do you want to see the solution for this challenge? Click here and here.
Challenge #10
Create a script that takes 3 arguments: a file extension, a source directory and a destination directory given as absolute or relative paths to the script. The script will copy all the files with that extension from the source directory to the destination directory.
Example: ./copy_files.sh png ~/images ~/backup/images
Are you stuck? Do you want to see the solution for this challenge? Click here and here.